When attaching an optical fiber to a substrate, forming a V-shaped groove in an SOI substrate by photolithographic etching and to place the optical fiber into the V-shaped groove is known, thereby accurately positioning the optical fiber with respect to a SOI substrate (for example, refer to JP-2002-107508-A (FIGS. 1 and 3)).